using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data.SqlClient;
using System.Drawing;
using System.Windows.Forms;
using AddMask;
using Consign.BizProcess;
using Consign.Entity;
using Item.BizProcess;
using Item.DataLibrary;
using Item.Entity;
using Newtonsoft.Json;
using ShouYang.Entity;
using Sybase.DataWindow;

namespace ShouYang;

public class Form_Import : Form
{
	public class Comboadd
	{
		public string name;

		public long id;

		public override string ToString()
		{
			return name;
		}
	}

	public class PublicData_ShouYang
	{
		public int TreeLevel;

		public long Kind_id;

		public long Item_id;

		public long Sample_id;

		public string IndexNo;

		public int MoreSample = 0;

		public string CurrentDwObject = "";

		public string GradeType = "";
	}

	private ShaImportEntity.ShaEntity.RetData SIE = new ShaImportEntity.ShaEntity.RetData();

	private string FirstDwSql = "";

	private string BeiAnZhengFilter = "";

	private PublicData_ShouYang Pd = new PublicData_ShouYang();

	private IContainer components = null;

	private TreeView TV_Sample;

	private GroupBox groupBox2;

	private ComboBox Combo_QiangDuDengJi;

	private Label label6;

	private Label label5;

	private ComboBox Combo_Guige;

	private ComboBox Combo_YPMC;

	private Label label4;

	private ComboBox Combo_YPLB;

	private Label label3;

	private ComboBox Combo_JCLX;

	private Label label2;

	private ImageList imageList1;

	private DataWindowControl Dw_Import;

	private GroupBox groupBox1;

	private ComboBox Combo_ShengChanChangJia;

	private Label label8;

	private Label label7;

	private DataWindowControl Dw_BeiAnZhengHao;

	private Button Btn_Delete;

	private Button Btn_Add;

	private Button button2;

	private Button Btn_Commit;

	private Button Btn_DownLoadItem;

	private TextBox Text_PiHao;

	private Label label1;

	private System.Windows.Forms.CheckBox Cb_ShowFinish;

	private Button Btn_Sort;

	private ComboBox Combo_Unit;

	private Label label10;

	private TextBox Text_Quan;

	private Label label9;

	private Button Btn_Export;

	private Button button1;

	private Button Btn_Print;

	private Button Btn_Hide;

	private ContextMenuStrip PopUpMemu;

	private ToolStripMenuItem Sort;

	private ToolStripMenuItem ShowColumns;

	private ToolStripMenuItem Export;

	private ToolStripMenuItem PrintSetUp;

	private ToolStripMenuItem Print;

	private DataWindowControl Dw_GetSample;

	private ToolStripMenuItem 修改样品信息ToolStripMenuItem;

	private System.Windows.Forms.CheckBox Cb_Year;

	private Label Label_LiuXiang;

	private ComboBox Cb_Liuxiang;

	public Form_Import()
	{
		InitializeComponent();
	}

	private static SqlConnection CreateConnection()
	{
		string connectionString = ConfigurationManager.ConnectionStrings["Consign"].ConnectionString;
		return new SqlConnection(connectionString);
	}

	private void SetDwColor(DataWindowControl dw)
	{
		string text = "";
		string text2 = "";
		string text3 = "";
		string text4 = "";
		int num = 0;
		dw.Modify("DataWindow.Grid.ColumnMove = No");
		dw.Modify("DataWindow.Selected.Mouse = No");
		text4 = dw.Describe("DataWindow.Objects").Trim() + "\t";
		while (text4.IndexOf('\t') > 0)
		{
			num = text4.IndexOf('\t');
			text2 = text4.Substring(0, num);
			text = dw.Describe(text2 + ".Band");
			if (text == "detail")
			{
				dw.Modify(text2 + ".Background.Mode='0'");
				dw.Modify(text2 + ".Background.Color = '16777215~tIf(GetRow() = CurrentRow(),16770740,If(Mod(GetRow(),2) = 0,15792895,15792880))'");
			}
			text4 = text4.Substring(num + 1, text4.Length - (num + 1));
		}
	}

	private long GetGuiGeIdByName(string Name, long SampleId)
	{
		long result = 0L;
		SpecBizProcess specBizProcess = new SpecBizProcess();
		List<SpecEntity> list = new List<SpecEntity>();
		list = specBizProcess.GetAll("", "SpecName='" + Name + "' and SampleID=" + SampleId, "");
		foreach (SpecEntity item in list)
		{
			result = item.SpecID;
		}
		return result;
	}

	private long GetGradeIdByName(string Name, long SampleId)
	{
		long result = 0L;
		GradeBizProcess gradeBizProcess = new GradeBizProcess();
		List<GradeEntity> list = new List<GradeEntity>();
		list = gradeBizProcess.GetAll("", "GradeName='" + Name + "' and SampleID=" + SampleId, "");
		foreach (GradeEntity item in list)
		{
			result = item.GradeID;
		}
		return result;
	}

	private void CreateTv(int Kind)
	{
		int num = 0;
		int num2 = 0;
		DataStore dataStore = new DataStore();
		Dw_Public.GetData_Ds(dataStore, "d_jbzkind_dis");
		if (Kind != 0)
		{
			dataStore.SetFilter("kindid=" + Kind);
			dataStore.Filter();
		}
		for (num = 1; num <= dataStore.RowCount; num++)
		{
			long num3 = (long)dataStore.GetItemDecimal(num, "kindid");
			string itemString = dataStore.GetItemString(num, "kindname");
			TreeNode treeNode = new TreeNode();
			treeNode.ImageIndex = 0;
			treeNode.SelectedImageIndex = 3;
			treeNode.Tag = num3;
			treeNode.Text = itemString;
			TV_Sample.Nodes.Add(treeNode);
			DataStore dataStore2 = new DataStore();
			Dw_Public.GetData_Ds(dataStore2, "d_jbzkind");
			dataStore2.SetFilter("kindid=" + num3);
			dataStore2.Filter();
			for (num2 = 1; num2 <= dataStore2.RowCount; num2++)
			{
				long num4 = (long)dataStore2.GetItemDecimal(num2, "ItemID");
				string itemString2 = dataStore2.GetItemString(num2, "item_item_itemname");
				TreeNode treeNode2 = new TreeNode();
				treeNode2.ImageIndex = 1;
				treeNode2.SelectedImageIndex = 4;
				treeNode2.Tag = num4;
				treeNode2.Text = itemString2;
				treeNode.Nodes.Add(treeNode2);
				Item.BizProcess.SampleBizProcess sampleBizProcess = new Item.BizProcess.SampleBizProcess();
				List<Item.Entity.SampleEntity> list = new List<Item.Entity.SampleEntity>();
				list = sampleBizProcess.GetAll("", "ItemID=" + num4 + " and CanConsign>0", "");
				foreach (Item.Entity.SampleEntity item in list)
				{
					long num5 = item.SampleID;
					string text = item.SampleName + "(" + item.SampleJudge + ")";
					TreeNode treeNode3 = new TreeNode();
					treeNode3.ImageIndex = 2;
					treeNode3.SelectedImageIndex = 5;
					treeNode3.Tag = num5;
					treeNode3.Text = text;
					treeNode2.Nodes.Add(treeNode3);
				}
			}
		}
	}

	private void GetImportData(int type, long SampleId)
	{
		string text = "";
		Dw_Import.LibraryList = "scetia.pbl";
		using SqlConnection sqlConnection = CreateConnection();
		sqlConnection.Open();
		AdoTransaction adoTransaction = new AdoTransaction(sqlConnection, "");
		adoTransaction.BindConnection();
		if (type == 0)
		{
			Dw_Import.DataWindowObject = "d_import_list";
			Dw_Import.SetTransaction(adoTransaction);
			Dw_Import.Retrieve();
			Dw_Import.Modify("checkflag_t.color=10789024");
			Dw_Import.Modify("checkflag.protect=1");
			if (FirstDwSql == "" || FirstDwSql == null)
			{
				FirstDwSql = Dw_Import.GetSqlSelect();
			}
		}
		if (type == 1)
		{
			text = text + " and Import_List.KindId =" + SampleId;
		}
		if (type == 2)
		{
			text = text + " and Import_List.ItemId =" + SampleId;
		}
		if (type == 3)
		{
			text = text + " and Import_List.SampleID =" + SampleId;
			Dw_Import.Modify("checkflag_t.color=16711680");
			Dw_Import.Modify("checkflag.protect=0");
		}
		string text2 = "";
		if (Cb_ShowFinish.Checked)
		{
			text = ((!Cb_Year.Checked) ? " and sampling=0 " : (text + " and sampling=0 and year(Import_List.Import_Date)=" + DateTime.Today.Year));
		}
		else if (Cb_Year.Checked)
		{
			text = text + " and year(Import_List.Import_Date)=" + DateTime.Today.Year;
		}
		text = FirstDwSql + text;
		using (SqlConnection sqlConnection2 = Dw_Public.CreateConnection())
		{
			sqlConnection2.Open();
			AdoTransaction adoTransaction2 = new AdoTransaction(sqlConnection2, "");
			adoTransaction2.BindConnection();
			Dw_Import.SetTransaction(adoTransaction2);
			Dw_Import.SetSqlSelect(text);
			Dw_Import.Retrieve();
			Dw_Public.SetDwColor(Dw_Import);
		}
		SetDwColor(Dw_Import);
		try
		{
			Dw_Import.ImeMode = ImeMode.OnHalf;
		}
		catch
		{
		}
		if (Dw_Import.RowCount <= 0)
		{
			try
			{
				Dw_GetSample.Reset();
			}
			catch
			{
			}
		}
		else
		{
			try
			{
				Dw_GetSample.LibraryList = "scetia.pbl";
				Dw_GetSample.DataWindowObject = "d_sample_import_find";
				Dw_GetSample.SetTransaction(adoTransaction);
				Dw_GetSample.Retrieve("%" + Dw_Import.GetItemString(1, "import_id") + "%");
				SetDwColor(Dw_GetSample);
			}
			catch
			{
			}
		}
		sqlConnection.Close();
	}

	private void Form_Import_Load(object sender, EventArgs e)
	{
		CreateTv(11);
		GetImportData(0, 0L);
		SetShaUi(0);
	}

	private void Btn_DownLoadItem_Click(object sender, EventArgs e)
	{
		Form_Wait form_Wait = new Form_Wait();
		form_Wait.Show();
		Application.DoEvents();
		string message = "";
		if (!DownLoadAll.DownKind(UserOfClientPart.userName, UserOfClientPart.userPwd, out message))
		{
			MessageBox.Show(message);
			return;
		}
		if (!DownLoadAll.DownItem(UserOfClientPart.userName, UserOfClientPart.userPwd, out message))
		{
			MessageBox.Show(message);
			return;
		}
		if (!DownLoadAll.DownSample(UserOfClientPart.userName, UserOfClientPart.userPwd, out message))
		{
			MessageBox.Show(message);
			return;
		}
		if (!DownLoadAll.DownSpec(UserOfClientPart.userName, UserOfClientPart.userPwd, out message))
		{
			MessageBox.Show(message);
			return;
		}
		if (!DownLoadAll.DownParameter(UserOfClientPart.userName, UserOfClientPart.userPwd, out message))
		{
			MessageBox.Show(message);
			return;
		}
		if (!DownLoadAll.DownGrade(UserOfClientPart.userName, UserOfClientPart.userPwd, out message))
		{
			MessageBox.Show(message);
			return;
		}
		if (!DownLoadAll.DownAllGJ_standard(UserOfClientPart.userName, UserOfClientPart.userPwd, out message))
		{
			MessageBox.Show(message);
			return;
		}
		if (!DownLoadAll.DownAllAgeTimeForSpecial(UserOfClientPart.userName, UserOfClientPart.userPwd, out message))
		{
			MessageBox.Show(message);
			return;
		}
		if (!DownLoadAll.DownAllSS_standard(UserOfClientPart.userName, UserOfClientPart.userPwd, out message))
		{
			MessageBox.Show(message);
			return;
		}
		if (!DownLoadAll.DownAllZ_MD_standard(UserOfClientPart.userName, UserOfClientPart.userPwd, out message))
		{
			MessageBox.Show(message);
			return;
		}
		if (!DownLoadAll.DownAllZ_QD_standard(UserOfClientPart.userName, UserOfClientPart.userPwd, out message))
		{
			MessageBox.Show(message);
			return;
		}
		if (!DownLoadAll.DownTestFee(UserOfClientPart.userName, UserOfClientPart.userPwd, out message))
		{
			MessageBox.Show(message);
			return;
		}
		TV_Sample.Nodes.Clear();
		CreateTv(11);
		form_Wait.Close();
		MessageBox.Show("下载成功!");
	}

	private void TV_Sample_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
	{
		int num = 0;
		int num2 = 0;
		string text = "";
		Pd.GradeType = "";
		Pd.TreeLevel = e.Node.ImageIndex;
		SqlConnection sqlConnection = CreateConnection();
		sqlConnection.Open();
		AdoTransaction adoTransaction = new AdoTransaction(sqlConnection, "");
		adoTransaction.BindConnection();
		BeiAnZhengFilter = "";
		switch (Pd.TreeLevel)
		{
		case 0:
			Combo_JCLX.Text = e.Node.Text;
			Pd.Kind_id = (long)e.Node.Tag;
			Combo_YPLB.Text = "";
			Combo_YPMC.Text = "";
			GetImportData(1, Pd.Kind_id);
			break;
		case 1:
		{
			Combo_YPLB.Text = e.Node.Text;
			Combo_JCLX.Text = e.Node.Parent.Text;
			Pd.Kind_id = (long)e.Node.Parent.Tag;
			Pd.Item_id = (long)e.Node.Tag;
			Combo_YPMC.Text = "";
			Combo_QiangDuDengJi.Items.Clear();
			Combo_Guige.Items.Clear();
			GetImportData(2, Pd.Item_id);
			DataStore dataStore2 = new DataStore();
			dataStore2.LibraryList = "scetia.pbl";
			dataStore2.DataWindowObject = "d_productionunittype";
			dataStore2.SetTransaction(adoTransaction);
			dataStore2.Retrieve(Pd.Sample_id);
			BeiAnZhengFilter = "";
			if (dataStore2.RowCount <= 0)
			{
				break;
			}
			int num3 = 0;
			for (num3 = 1; num3 <= dataStore2.RowCount; num3++)
			{
				BeiAnZhengFilter = BeiAnZhengFilter + " or ProductionUnitType='" + dataStore2.GetItemString(num3, "typecode") + "'";
			}
			BeiAnZhengFilter = "(" + BeiAnZhengFilter.Substring(4, BeiAnZhengFilter.Length - 4) + ")";
			Dw_BeiAnZhengHao.LibraryList = "scetia.pbl";
			Dw_BeiAnZhengHao.DataWindowObject = "d_dp_beianzheng_child";
			Dw_BeiAnZhengHao.SetTransaction(adoTransaction);
			DataWindowChild child = Dw_BeiAnZhengHao.GetChild("putonrecordspassport");
			child.SetTransaction(adoTransaction);
			if (BeiAnZhengFilter != "")
			{
				child.SetFilter("");
				child.Filter();
				child.Reset();
				child.Retrieve();
				child.SetFilter(BeiAnZhengFilter);
				child.Filter();
			}
			if (child.RowCount > 0)
			{
				Dw_BeiAnZhengHao.Reset();
				Dw_BeiAnZhengHao.Retrieve(BeiAnZhengFilter);
				if (Dw_BeiAnZhengHao.RowCount > 0)
				{
					Dw_BeiAnZhengHao.SetItemString(Dw_BeiAnZhengHao.CurrentRow, "putonrecordspassport", child.GetItemString(child.CurrentRow, "putonrecordspassport"));
					Combo_ShengChanChangJia.Text = child.GetItemString(child.CurrentRow, "name");
					Combo_ShengChanChangJia.Enabled = false;
				}
			}
			else
			{
				Combo_ShengChanChangJia.Text = "";
				Combo_ShengChanChangJia.Enabled = true;
			}
			if (dataStore2.RowCount <= 0 && Dw_BeiAnZhengHao.RowCount > 0)
			{
				Dw_BeiAnZhengHao.Reset();
			}
			break;
		}
		case 2:
		{
			Combo_YPMC.Text = e.Node.Text;
			Combo_YPLB.Text = e.Node.Parent.Text;
			Combo_JCLX.Text = e.Node.Parent.Parent.Text;
			Pd.Kind_id = (long)e.Node.Parent.Parent.Tag;
			Pd.Item_id = (long)e.Node.Parent.Tag;
			Pd.Sample_id = (long)e.Node.Tag;
			Pd.GradeType = "";
			GetImportData(3, Pd.Sample_id);
			Combo_Guige.Items.Clear();
			SpecBizProcess specBizProcess = new SpecBizProcess();
			List<SpecEntity> list = new List<SpecEntity>();
			list = specBizProcess.GetAll("", "SampleID=" + e.Node.Tag, "");
			foreach (SpecEntity item in list)
			{
				Comboadd comboadd = new Comboadd();
				comboadd.id = item.SpecID;
				comboadd.name = item.SpecName;
				Combo_Guige.Items.Add(comboadd);
			}
			Combo_QiangDuDengJi.Items.Clear();
			GradeBizProcess gradeBizProcess = new GradeBizProcess();
			List<GradeEntity> list2 = new List<GradeEntity>();
			list2 = gradeBizProcess.GetAll("", "SampleID=" + e.Node.Tag, "");
			foreach (GradeEntity item2 in list2)
			{
				if (item2.GradeType == "" || item2.GradeType == "强度")
				{
					Comboadd comboadd = new Comboadd();
					comboadd.id = item2.GradeID;
					comboadd.name = item2.GradeName;
					Combo_QiangDuDengJi.Items.Add(comboadd);
				}
				if (item2.GradeType != "" || item2.GradeType != null)
				{
					if (Pd.GradeType == "" && item2.GradeType != "强度")
					{
						Pd.GradeType = item2.GradeType;
					}
					if (Pd.GradeType == "密度" && item2.GradeType == "外观")
					{
						Pd.GradeType = "密度,外观";
					}
					if (Pd.GradeType == "外观" && item2.GradeType == "密度")
					{
						Pd.GradeType = "密度,外观";
					}
				}
				else
				{
					Pd.GradeType = "";
				}
			}
			if (Pd.Item_id == 1105 || Pd.Item_id == 1122)
			{
				label7.Text = "许可证号";
			}
			else
			{
				label7.Text = "备案证号";
			}
			DataStore dataStore = new DataStore();
			dataStore.LibraryList = "scetia.pbl";
			dataStore.DataWindowObject = "d_productionunittype";
			dataStore.SetTransaction(adoTransaction);
			dataStore.Retrieve(Pd.Sample_id);
			if (dataStore.RowCount > 0)
			{
				int num3 = 0;
				for (num3 = 1; num3 <= dataStore.RowCount; num3++)
				{
					BeiAnZhengFilter = BeiAnZhengFilter + " or ProductionUnitType='" + dataStore.GetItemString(num3, "typecode") + "'";
				}
				BeiAnZhengFilter = "(" + BeiAnZhengFilter.Substring(4, BeiAnZhengFilter.Length - 4) + ")";
				Dw_BeiAnZhengHao.LibraryList = "scetia.pbl";
				Dw_BeiAnZhengHao.DataWindowObject = "d_dp_beianzheng_child";
				Dw_BeiAnZhengHao.SetTransaction(adoTransaction);
				DataWindowChild child = Dw_BeiAnZhengHao.GetChild("putonrecordspassport");
				child.SetTransaction(adoTransaction);
				if (BeiAnZhengFilter != "")
				{
					child.SetFilter("");
					child.Filter();
					child.Reset();
					child.Retrieve();
					child.SetFilter(BeiAnZhengFilter);
					child.Filter();
					try
					{
						child.InsertRow(1);
					}
					catch
					{
					}
				}
				if (child.RowCount > 0)
				{
					Dw_BeiAnZhengHao.Retrieve();
					if (Dw_BeiAnZhengHao.RowCount > 0)
					{
						try
						{
							Dw_BeiAnZhengHao.SetItemString(Dw_BeiAnZhengHao.CurrentRow, "putonrecordspassport", child.GetItemString(child.CurrentRow, "putonrecordspassport"));
							Combo_ShengChanChangJia.Text = child.GetItemString(child.CurrentRow, "name");
							Combo_ShengChanChangJia.Enabled = true;
						}
						catch
						{
						}
					}
					if (Dw_BeiAnZhengHao.RowCount <= 0)
					{
						Dw_BeiAnZhengHao.Reset();
					}
				}
				else
				{
					Combo_ShengChanChangJia.Text = "";
					Combo_ShengChanChangJia.Enabled = true;
				}
			}
			else
			{
				try
				{
					Dw_BeiAnZhengHao.LibraryList = "scetia.pbl";
					Dw_BeiAnZhengHao.DataWindowObject = "d_dp_beianzheng_child";
					Dw_BeiAnZhengHao.SetTransaction(adoTransaction);
					DataWindowChild child = Dw_Import.GetChild("record_certificate");
					child.SetTransaction(adoTransaction);
					child.Reset();
					child.InsertRow(0);
				}
				catch
				{
				}
				Combo_ShengChanChangJia.Text = "";
				Combo_ShengChanChangJia.Enabled = true;
			}
			if (Pd.Sample_id != 110312)
			{
			}
			break;
		}
		}
	}

	private void Combo_ShengChanChangJia_SelectedIndexChanged(object sender, EventArgs e)
	{
	}

	private void Btn_Add_Click(object sender, EventArgs e)
	{
		Dw_Import.AcceptText();
		Dw_Public.Save(Dw_Import);
	}

	private void Dw_BeiAnZhengHao_ItemChanged(object sender, Sybase.DataWindow.ItemChangedEventArgs e)
	{
		try
		{
			DataWindowChild child = Dw_BeiAnZhengHao.GetChild("putonrecordspassport");
			Combo_ShengChanChangJia.Text = child.GetItemString(child.CurrentRow, "name");
		}
		catch
		{
		}
	}

	private void Btn_Delete_Click(object sender, EventArgs e)
	{
		if (Dw_Import.RowCount <= 0)
		{
			MessageBox.Show("没有需要删除的内容!");
			return;
		}
		DataStore dataStore = new DataStore();
		SqlCommand sqlCommand = new SqlCommand();
		using (SqlConnection sqlConnection = Dw_Public.CreateConnection())
		{
			sqlConnection.Open();
			AdoTransaction adoTransaction = new AdoTransaction(sqlConnection, "");
			adoTransaction.BindConnection();
			dataStore.LibraryList = "scetia.pbl";
			dataStore.DataWindowObject = "d_sample_import_find";
			dataStore.SetTransaction(adoTransaction);
			dataStore.Retrieve("%" + Dw_Import.GetItemString(Dw_Import.CurrentRow, "import_id") + "%");
			sqlConnection.Close();
		}
		int num = 0;
		string text = "";
		for (num = 1; num <= dataStore.RowCount; num++)
		{
			text = text + dataStore.GetItemString(num, "sample_id") + ";";
		}
		if (dataStore.RowCount <= 0)
		{
			if (MessageBox.Show("确实要删除此条进仓信息吗?删除后不可恢复!", "警告", MessageBoxButtons.OKCancel) == DialogResult.OK)
			{
				Dw_Import.DeleteRow(0);
			}
			Dw_Public.Save_NoMessage(Dw_Import);
		}
		else
		{
			MessageBox.Show("当前进料信息不可删除,原因:已有样品(" + text + ")生成，删除这些样品后，再进行删除进料操作!");
		}
	}

	private void Btn_Commit_Click(object sender, EventArgs e)
	{
		int num = 0;
		string text = "";
		string text2 = "";
		if (Pd.TreeLevel < 2)
		{
			MessageBox.Show("请选择你所需要操作的样品！");
			return;
		}
		if (Combo_JCLX.Text == "")
		{
			MessageBox.Show("请选择您所要委托的检测类型");
		}
		if (Combo_YPLB.Text == "")
		{
			MessageBox.Show("请选择您所需要委托的样品类别！");
			return;
		}
		if (Combo_YPMC.Text == "")
		{
			MessageBox.Show("请选择您所需要委托的样品名称");
			return;
		}
		if (Combo_Guige.Text == "" && Combo_Guige.Items.Count > 0)
		{
			MessageBox.Show("请选择你所需要操作的规格！");
			return;
		}
		if (Combo_QiangDuDengJi.Text == "" && Combo_QiangDuDengJi.Items.Count > 0)
		{
			MessageBox.Show("请选择你所需要操作的强度等级！");
			return;
		}
		if (Text_PiHao.Text == "")
		{
			MessageBox.Show("请录入此原材料的进仓批号!");
			return;
		}
		if (Text_Quan.Text == "")
		{
			MessageBox.Show("请录入此原材料的进仓数量!");
			return;
		}
		CurrentIdBizProcess currentIdBizProcess = new CurrentIdBizProcess();
		List<CurrentIdEntity> list = new List<CurrentIdEntity>();
		list = currentIdBizProcess.GetAll("", "YearStr='" + DateTime.Today.Year + "'", "");
		if (list.Count > 0)
		{
			foreach (CurrentIdEntity item in list)
			{
				text = ((item.CurrentImportId == null) ? (DateTime.Today.Year + "000001") : item.CurrentImportId);
				using (SqlConnection sqlConnection = Dw_Public.CreateConnection())
				{
					sqlConnection.Open();
					string cmdText = "select max(Import_Id) from Import_List where left(Import_id,4)='" + DateTime.Today.Year.ToString().Substring(0, 4) + "'";
					SqlCommand sqlCommand = new SqlCommand(cmdText, sqlConnection);
					try
					{
						text2 = Convert.ToString(sqlCommand.ExecuteScalar());
					}
					catch
					{
					}
					sqlConnection.Close();
				}
				if (text2 != "" && Convert.ToInt64(text2) >= Convert.ToInt64(text))
				{
					if (MessageBox.Show("当前存在的进料编号编号,大于等于编号设置中的下一编号,处理方法:\n按是系统自动在最大进料编号+1做为新编号并继续提交!\n按否取消提交操作用户自行处理!", "警告", MessageBoxButtons.YesNo) != DialogResult.Yes)
					{
						return;
					}
					text = (Convert.ToInt64(text2) + 1).ToString();
				}
				Dw_Import.InsertRow(0);
				Dw_Import.ScrollToRow(Dw_Import.RowCount);
				Dw_Import.SelectRow(Dw_Import.RowCount, Select: false);
				Dw_Import.SetItemDecimal(Dw_Import.CurrentRow, "kindid", Pd.Kind_id);
				Dw_Import.SetItemDecimal(Dw_Import.CurrentRow, "itemid", Pd.Item_id);
				Dw_Import.SetItemDecimal(Dw_Import.CurrentRow, "sampleid", Pd.Sample_id);
				Dw_Import.SetItemDecimal(Dw_Import.CurrentRow, "specid", (int)GetGuiGeIdByName(Combo_Guige.Text, Pd.Sample_id));
				Dw_Import.SetItemDecimal(Dw_Import.CurrentRow, "gradeid", (int)GetGradeIdByName(Combo_QiangDuDengJi.Text, Pd.Sample_id));
				if (Dw_BeiAnZhengHao.RowCount > 0)
				{
					Dw_Import.SetItemString(Dw_Import.CurrentRow, "record_certificate", Dw_BeiAnZhengHao.GetItemString(Dw_BeiAnZhengHao.CurrentRow, "putonrecordspassport"));
				}
				Dw_Import.SetItemString(Dw_Import.CurrentRow, "factory_name", Combo_ShengChanChangJia.Text);
				Dw_Import.SetItemString(Dw_Import.CurrentRow, "groupid", Text_PiHao.Text);
				Dw_Import.SetItemDecimal(Dw_Import.CurrentRow, "prodin_quan", Convert.ToDecimal(Text_Quan.Text));
				Dw_Import.SetItemString(Dw_Import.CurrentRow, "prodin_unit", Combo_Unit.Text);
				for (num = 1; num <= Dw_Import.RowCount; num++)
				{
					if (Dw_Import.GetItemString(num, "import_id") == "-1")
					{
						Dw_Import.SetItemString(num, "import_id", text);
						Dw_Import.SetItemString(Dw_Import.CurrentRow, "Upload_Flag", global::AddMask.AddMask.CtoGB_Num(text, "c", DateTime.Now));
						text = (Convert.ToInt64(text) + 1).ToString();
					}
				}
				item.CurrentImportId = text;
				currentIdBizProcess.InsertUpdate(item);
			}
		}
		else
		{
			text = DateTime.Today.Year + "000001";
			using (SqlConnection sqlConnection = Dw_Public.CreateConnection())
			{
				sqlConnection.Open();
				string cmdText = "select max(Import_Id) from Import_List";
				SqlCommand sqlCommand = new SqlCommand(cmdText, sqlConnection);
				try
				{
					text2 = Convert.ToString(sqlCommand.ExecuteScalar());
				}
				catch
				{
				}
				sqlConnection.Close();
			}
			if (text2 != "" && Convert.ToInt64(text2) >= Convert.ToInt64(text))
			{
				MessageBox.Show("当前存在的进料编号,大于等于编号设置中的下一编号,请检查编号设置,操作取消!");
				return;
			}
			Dw_Import.InsertRow(0);
			Dw_Import.ScrollToRow(Dw_Import.RowCount);
			Dw_Import.SelectRow(Dw_Import.RowCount, Select: false);
			Dw_Import.SetItemDecimal(Dw_Import.CurrentRow, "kindid", Pd.Kind_id);
			Dw_Import.SetItemDecimal(Dw_Import.CurrentRow, "itemid", Pd.Item_id);
			Dw_Import.SetItemDecimal(Dw_Import.CurrentRow, "sampleid", Pd.Sample_id);
			Dw_Import.SetItemDecimal(Dw_Import.CurrentRow, "specid", (int)GetGuiGeIdByName(Combo_Guige.Text, Pd.Sample_id));
			Dw_Import.SetItemDecimal(Dw_Import.CurrentRow, "gradeid", (int)GetGradeIdByName(Combo_QiangDuDengJi.Text, Pd.Sample_id));
			if (Dw_BeiAnZhengHao.RowCount > 0)
			{
				Dw_Import.SetItemString(Dw_Import.CurrentRow, "record_certificate", Dw_BeiAnZhengHao.GetItemString(Dw_BeiAnZhengHao.CurrentRow, "putonrecordspassport"));
				Dw_Import.SetItemString(Dw_Import.CurrentRow, "factory_name", Combo_ShengChanChangJia.Text);
			}
			Dw_Import.SetItemString(Dw_Import.CurrentRow, "groupid", Text_PiHao.Text);
			Dw_Import.SetItemDecimal(Dw_Import.CurrentRow, "prodin_quan", Convert.ToDecimal(Text_Quan.Text));
			Dw_Import.SetItemString(Dw_Import.CurrentRow, "prodin_unit", Combo_Unit.Text);
			for (num = 1; num <= Dw_Import.RowCount; num++)
			{
				if (Dw_Import.GetItemString(num, "import_id") == "-1")
				{
					Dw_Import.SetItemString(num, "import_id", text);
					Dw_Import.SetItemString(Dw_Import.CurrentRow, "Upload_Flag", global::AddMask.AddMask.CtoGB_Num(text, "c", DateTime.Now));
					text = (Convert.ToInt64(text) + 1).ToString();
				}
			}
			using SqlConnection sqlConnection = Dw_Public.CreateConnection();
			sqlConnection.Open();
			string cmdText = "Insert into WT_CurrentId(YearStr,CurrentImportId,CurrentConsignId,CurrentSampleId) Values('" + DateTime.Today.Year + "','" + DateTime.Today.Year + "000002','0000000001','0000000001')";
			SqlCommand sqlCommand = new SqlCommand(cmdText, sqlConnection);
			try
			{
				sqlCommand.ExecuteNonQuery();
			}
			catch
			{
			}
			sqlConnection.Close();
		}
		Dw_Import.AcceptText();
		using (SqlConnection sqlConnection = CreateConnection())
		{
			sqlConnection.Open();
			AdoTransaction adoTransaction = new AdoTransaction(sqlConnection, "");
			adoTransaction.BindConnection();
			Dw_Import.SetTransaction(adoTransaction);
			try
			{
				Dw_Import.AcceptText();
				Dw_Import.UpdateData();
				string text3 = "";
				try
				{
					text3 = Dw_Import.GetItemString(Dw_Import.CurrentRow, "prodin_unit");
				}
				catch
				{
				}
				string cmdText = "Update Import_List Set Prodin_Unit=N'" + text3 + "' where Import_Id='" + Dw_Import.GetItemString(Dw_Import.CurrentRow, "import_id") + "'";
				SqlCommand sqlCommand = new SqlCommand(cmdText, sqlConnection);
				try
				{
					sqlCommand.ExecuteNonQuery();
				}
				catch
				{
				}
			}
			catch (DbErrorException ex)
			{
				MessageBox.Show("更新不成功！原因：" + ex.SqlErrorText);
				return;
			}
			catch (DataWindowNotCreatedException)
			{
				MessageBox.Show("数据窗口还没有创建！");
				return;
			}
			catch (MethodFailureException ex3)
			{
				MessageBox.Show("更新不成功！原因：" + ex3.Message.ToString());
				return;
			}
			catch
			{
				MessageBox.Show("更新不成功,请检查网络！");
				return;
			}
			MessageBox.Show("提交(保存)数据成功!");
		}
		try
		{
			Dw_Public_New.GetData(Dw_Import, "scetia.pbl", "d_import_list", 1, Pd.Sample_id);
		}
		catch
		{
		}
	}

	private void Dw_Import_SqlPreview(object sender, SqlPreviewEventArgs e)
	{
	}

	private void Dw_Import_KeyDown(object sender, KeyEventArgs e)
	{
		if (e.KeyCode == Keys.Return)
		{
			SendKeys.Send("{tab}");
			e.SuppressKeyPress = true;
		}
	}

	private void Btn_Sort_Click(object sender, EventArgs e)
	{
		Form_Sort form_Sort = new Form_Sort();
		form_Sort.Dw_Sort = Dw_Import;
		form_Sort.ShowDialog();
		Dw_Import.SetSort(Public_Data.Sort_Str);
		Dw_Import.Sort();
	}

	private void button2_Click(object sender, EventArgs e)
	{
		Close();
	}

	private void Dw_Import_Click(object sender, EventArgs e)
	{
	}

	private void Dw_Import_ItemFocusChanged(object sender, ItemFocusChangedEventArgs e)
	{
		try
		{
			if (Dw_Import.GetColumnName() == "reportid")
			{
				DataWindowChild child = Dw_Import.GetChild("reportid");
				using SqlConnection sqlConnection = Dw_Public.CreateConnection();
				sqlConnection.Open();
				AdoTransaction adoTransaction = new AdoTransaction(sqlConnection, "");
				adoTransaction.BindConnection();
				child.SetTransaction(adoTransaction);
				child.Retrieve(Dw_Import.GetItemString(Dw_Import.CurrentRow, "sampleid"), Dw_Import.GetItemString(Dw_Import.CurrentRow, "specid"), Dw_Import.GetItemString(Dw_Import.CurrentRow, "gradeid"), Dw_Import.GetItemString(Dw_Import.CurrentRow, "record_certificate"), Dw_Import.GetItemString(Dw_Import.CurrentRow, "groupid"));
				sqlConnection.Close();
				return;
			}
		}
		catch
		{
		}
	}

	private void Text_Quan_KeyPress(object sender, KeyPressEventArgs e)
	{
		if (e.KeyChar != '\b' && !char.IsDigit(e.KeyChar) && e.KeyChar != '.')
		{
			e.Handled = true;
		}
	}

	private void Dw_Import_ItemChanged(object sender, Sybase.DataWindow.ItemChangedEventArgs e)
	{
		if (e.ColumnName == "reportid")
		{
			Dw_Public.Save_NoMessage(Dw_Import);
			if (e.Data != "" && e.Data != null)
			{
				DataWindowChild child = Dw_Import.GetChild("reportid");
				string itemString = Dw_Import.GetItemString(Dw_Import.CurrentRow, "import_id");
				int num = 0;
				if (child.FindRow("report_id='" + e.Data + "'", 1, child.RowCount) <= 0)
				{
					MessageBox.Show("请录入正确的报告编号或者直接由下拉列表中选择!");
					e.Action = ItemChangedAction.RejectAndAllowFocusChange;
					Dw_Import.SetItemString(Dw_Import.CurrentRow, "reportid", "");
					return;
				}
				DataStore dataStore = new DataStore();
				using (SqlConnection sqlConnection = Dw_Public.CreateConnection())
				{
					sqlConnection.Open();
					AdoTransaction adoTransaction = new AdoTransaction(sqlConnection, "");
					adoTransaction.BindConnection();
					dataStore.LibraryList = "scetia.pbl";
					dataStore.DataWindowObject = "d_sample_import_find";
					dataStore.SetTransaction(adoTransaction);
					dataStore.Retrieve("%" + itemString + "%");
					string cmdText = "SELECT SUM(Prodin_Quan)  FROM Import_List WHERE (ReportId = '" + e.Data + "')";
					double value = 0.0;
					SqlCommand sqlCommand = new SqlCommand(cmdText, sqlConnection);
					try
					{
						value = Convert.ToDouble(sqlCommand.ExecuteScalar());
					}
					catch
					{
					}
					for (num = 1; num <= dataStore.RowCount; num++)
					{
						dataStore.SetItemDecimal(num, "delegate_quan", Convert.ToDecimal(value));
					}
					Dw_Public.Save_NoMessage_Ds(dataStore);
					sqlConnection.Close();
				}
				Dw_Import.SetItemDecimal(Dw_Import.CurrentRow, "sampling", 1m);
				Dw_Public.Save_NoMessage(Dw_Import);
			}
		}
		if (e.ColumnName == "record_certificate")
		{
			try
			{
				DataWindowChild child2 = Dw_Import.GetChild("record_certificate");
				Dw_Import.SetItemString(e.RowNumber, "factory_name", child2.GetItemString(child2.CurrentRow, "name"));
				if (Dw_GetSample.RowCount > 0)
				{
					int num = 0;
					for (num = 1; num <= Dw_GetSample.RowCount; num++)
					{
						Dw_GetSample.SetItemString(num, "record_certificate", e.Data);
						Dw_GetSample.SetItemString(num, "produce_factory", Dw_Import.GetItemString(e.RowNumber, "factory_name"));
					}
				}
			}
			catch
			{
				Dw_Import.SetItemString(e.RowNumber, "factory_name", "");
			}
			Dw_Public.Save_NoMessage(Dw_Import);
			Dw_Public.Save_NoMessage(Dw_GetSample);
		}
		if (e.ColumnName == "factory_name")
		{
			Dw_Import.AcceptText();
			try
			{
				if (Dw_GetSample.RowCount > 0)
				{
					int num = 0;
					for (num = 1; num <= Dw_GetSample.RowCount; num++)
					{
						Dw_GetSample.SetItemString(num, "produce_factory", e.Data);
					}
				}
			}
			catch
			{
				Dw_Import.SetItemString(e.RowNumber, "factory_name", "");
			}
			Dw_Public.Save_NoMessage(Dw_Import);
			Dw_Public.Save_NoMessage(Dw_GetSample);
		}
		try
		{
			string itemString = Dw_Import.GetItemString(e.RowNumber, "import_id");
			if (itemString != "-1")
			{
				Dw_Import.SetItemString(Dw_Import.CurrentRow, "Upload_Flag", global::AddMask.AddMask.CtoGB_Num(itemString, "c", DateTime.Now));
			}
		}
		catch
		{
		}
	}

	private void Dw_Import_EditChanged(object sender, EditChangedEventArgs e)
	{
	}

	private void button1_Click(object sender, EventArgs e)
	{
		SaveFileDialog saveFileDialog = new SaveFileDialog();
		saveFileDialog.Filter = "Excel文件 (*.xls)| *.xls|HTML文件 (*.html)| *.HTML|XML文件 (*.XML)| *.XML|Word 文件 (*.doc)| *.doc,";
		if (saveFileDialog.ShowDialog() == DialogResult.OK)
		{
			Dw_Import.SaveAs(saveFileDialog.FileName, FileSaveAsType.HtmlTable, IncludeColumnHeaders: true);
		}
	}

	private void button1_Click_1(object sender, EventArgs e)
	{
		Dw_Import.PrintDialog();
	}

	private void Btn_Print_Click(object sender, EventArgs e)
	{
		try
		{
			Dw_Import.Print();
		}
		catch
		{
		}
	}

	private void Btn_Hide_Click(object sender, EventArgs e)
	{
		string text = "";
		Form_Hide form_Hide = new Form_Hide();
		form_Hide.Dw_Hide = Dw_Import;
		form_Hide.ShowDialog();
		text = Public_Data.Hide_Str;
		while (text != "")
		{
			int num = 0;
			string text2 = "";
			num = text.IndexOf("|");
			if (num >= 0)
			{
				text2 = text.Substring(0, num);
			}
			else
			{
				text2 = text;
				text = "";
			}
			Dw_Import.Modify(text2);
			try
			{
				text = text.Substring(num + 1, text.Length - num - 1);
			}
			catch
			{
			}
		}
	}

	private void Dw_BeiAnZhengHao_EditChanged(object sender, EditChangedEventArgs e)
	{
		DataWindowChild child = Dw_BeiAnZhengHao.GetChild("putonrecordspassport");
		if (BeiAnZhengFilter != "")
		{
			child.SetFilter("");
			child.Filter();
			child.Reset();
			Dw_Public.GetData_Dc(child);
			if (e.Data == "")
			{
				child.SetFilter(BeiAnZhengFilter);
			}
			else
			{
				child.SetFilter(BeiAnZhengFilter + " and putonrecordspassport like '%" + e.Data + "%'");
			}
			child.Filter();
		}
	}

	private void Dw_Import_MouseClick(object sender, MouseEventArgs e)
	{
		if (e.Button == MouseButtons.Right)
		{
			Point screenLocation = default(Point);
			screenLocation.X = Control.MousePosition.X;
			screenLocation.Y = Control.MousePosition.Y;
			PopUpMemu.Show(screenLocation);
		}
	}

	private void PopUpMemu_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
	{
		PopUpMemu.Hide();
		if (e.ClickedItem.ToString() == "排序")
		{
			Form_Sort form_Sort = new Form_Sort();
			form_Sort.Dw_Sort = Dw_Import;
			form_Sort.ShowDialog();
			Dw_Import.SetSort(Public_Data.Sort_Str);
			Dw_Import.Sort();
		}
		if (e.ClickedItem.ToString() == "显示/隐藏列")
		{
			string text = "";
			Form_Hide form_Hide = new Form_Hide();
			form_Hide.Dw_Hide = Dw_Import;
			form_Hide.ShowDialog();
			text = Public_Data.Hide_Str;
			while (text != "")
			{
				int num = 0;
				string text2 = "";
				num = text.IndexOf("|");
				if (num >= 0)
				{
					text2 = text.Substring(0, num);
				}
				else
				{
					text2 = text;
					text = "";
				}
				Dw_Import.Modify(text2);
				try
				{
					text = text.Substring(num + 1, text.Length - num - 1);
				}
				catch
				{
				}
			}
		}
		if (e.ClickedItem.ToString() == "导出数据")
		{
			SaveFileDialog saveFileDialog = new SaveFileDialog();
			saveFileDialog.Filter = "Excel文件 (*.xls)| *.xls|HTML文件 (*.html)| *.HTML|XML文件 (*.XML)| *.XML|Word 文件 (*.doc)| *.doc,";
			if (saveFileDialog.ShowDialog() == DialogResult.OK)
			{
				Dw_Import.SaveAs(saveFileDialog.FileName, FileSaveAsType.HtmlTable, IncludeColumnHeaders: true);
			}
		}
		if (e.ClickedItem.ToString() == "打印设置")
		{
			try
			{
				Dw_Import.PrintDialog();
			}
			catch
			{
			}
		}
		if (e.ClickedItem.ToString() == "打印")
		{
			try
			{
				Dw_Import.Print();
			}
			catch
			{
			}
		}
		if (!(e.ClickedItem.ToString() == "修改进料信息"))
		{
			return;
		}
		try
		{
			if (Dw_GetSample.RowCount > 0)
			{
				if (MessageBox.Show("当前进料信息下已经取样，替换进料信息将会更新这些样品信息是否继续？", "提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
				{
					Form_ModifyImport form_ModifyImport = new Form_ModifyImport();
					form_ModifyImport.Label_Sample.Text = Dw_Import.GetItemString(Dw_Import.CurrentRow, "import_id");
					form_ModifyImport.Lab_Sample.Text = Dw_Import.GetItemDecimal(Dw_Import.CurrentRow, "sampleid").ToString();
					form_ModifyImport.Lab_Grade.Text = Dw_Import.GetItemDecimal(Dw_Import.CurrentRow, "gradeid").ToString();
					form_ModifyImport.Lab_Spec.Text = Dw_Import.GetItemDecimal(Dw_Import.CurrentRow, "specid").ToString();
					form_ModifyImport.ShowDialog();
				}
			}
			else
			{
				Form_ModifyImport form_ModifyImport = new Form_ModifyImport();
				form_ModifyImport.Label_Sample.Text = Dw_Import.GetItemString(Dw_Import.CurrentRow, "import_id");
				form_ModifyImport.Lab_Sample.Text = Dw_Import.GetItemDecimal(Dw_Import.CurrentRow, "sampleid").ToString();
				form_ModifyImport.Lab_Grade.Text = Dw_Import.GetItemDecimal(Dw_Import.CurrentRow, "gradeid").ToString();
				form_ModifyImport.Lab_Spec.Text = Dw_Import.GetItemDecimal(Dw_Import.CurrentRow, "specid").ToString();
				form_ModifyImport.ShowDialog();
			}
			try
			{
				string itemString = Dw_Import.GetItemString(Dw_Import.CurrentRow, "import_id");
				Dw_Import.SetItemString(Dw_Import.CurrentRow, "Upload_Flag", global::AddMask.AddMask.CtoGB_Num(itemString, "c", DateTime.Now));
				Dw_Public.Save_NoMessage(Dw_Import);
			}
			catch
			{
			}
			using SqlConnection sqlConnection = Dw_Public.CreateConnection();
			sqlConnection.Open();
			AdoTransaction adoTransaction = new AdoTransaction(sqlConnection, "");
			adoTransaction.BindConnection();
			Dw_Import.LibraryList = "scetia.pbl";
			Dw_Import.DataWindowObject = "d_import_retrieve";
			Dw_Import.SetTransaction(adoTransaction);
			Dw_Import.Retrieve(Pd.Sample_id);
			Dw_Import.Modify("DataWindow.Grid.ColumnMove = No");
			Dw_Import.Modify("DataWindow.Selected.Mouse = No");
			SetDwColor(Dw_Import);
			sqlConnection.Close();
		}
		catch
		{
		}
	}

	private void Dw_Import_RowFocusChanged(object sender, RowFocusChangedEventArgs e)
	{
		try
		{
			using SqlConnection sqlConnection = Dw_Public.CreateConnection();
			sqlConnection.Open();
			AdoTransaction adoTransaction = new AdoTransaction(sqlConnection, "");
			adoTransaction.BindConnection();
			Dw_GetSample.LibraryList = "scetia.pbl";
			Dw_GetSample.DataWindowObject = "d_sample_import_find";
			Dw_GetSample.SetTransaction(adoTransaction);
			Dw_GetSample.Retrieve("%" + Dw_Import.GetItemString(e.RowNumber, "import_id") + "%");
			SetDwColor(Dw_GetSample);
			sqlConnection.Close();
		}
		catch
		{
		}
	}

	private void ChangeShaNo(string LiuXiangNo)
	{
		ShaImportEntity.ShaEntity.Result result = SIE.result.Find((ShaImportEntity.ShaEntity.Result c) => c.flowInfoNo == LiuXiangNo);
		if (result.flowInfoNo != "")
		{
			Combo_Guige.Text = result.spec_Cn;
			Combo_QiangDuDengJi.Text = result.grade_Cn;
			Combo_ShengChanChangJia.Text = result.produce_Factory;
			Text_Quan.Text = result.delegate_Quan;
			Combo_Unit.Text = result.delegate_Quan_Unit;
			Dw_Public_New.SetItemString(Dw_BeiAnZhengHao, 1, "putonrecordspassport", result.record_Certificate, 0);
			Label_LiuXiang.Visible = true;
			Cb_Liuxiang.Visible = true;
			Combo_Guige.Enabled = false;
			Combo_QiangDuDengJi.Enabled = false;
			Dw_BeiAnZhengHao.Enabled = false;
			Combo_ShengChanChangJia.Enabled = false;
			Text_Quan.Enabled = false;
			Combo_Unit.Enabled = false;
		}
	}

	private void SetShaUi(int Status)
	{
		if (Status == 1)
		{
			Cb_Liuxiang.Items.Clear();
			GetShaData();
			int num = 0;
			List<string> list = new List<string>();
			for (num = 0; num < SIE.result.Count; num++)
			{
				list.Add(SIE.result[num].flowInfoNo);
			}
			list.Sort();
			list.Reverse();
			for (num = 0; num < list.Count; num++)
			{
				Cb_Liuxiang.Items.Add(list[num].ToString());
			}
			string FirstLiuxiangNo = list[0].ToString();
			Cb_Liuxiang.Text = FirstLiuxiangNo;
			ShaImportEntity.ShaEntity.Result result = SIE.result.Find((ShaImportEntity.ShaEntity.Result c) => c.flowInfoNo == FirstLiuxiangNo);
			Combo_Guige.Text = result.spec_Cn;
			Combo_QiangDuDengJi.Text = result.grade_Cn;
			Combo_ShengChanChangJia.Text = result.produce_Factory;
			Text_Quan.Text = result.delegate_Quan;
			Combo_Unit.Text = result.delegate_Quan_Unit;
			Dw_Public_New.SetItemString(Dw_BeiAnZhengHao, 1, "putonrecordspassport", result.record_Certificate, 0);
			Label_LiuXiang.Visible = true;
			Cb_Liuxiang.Visible = true;
			Combo_Guige.Enabled = false;
			Combo_QiangDuDengJi.Enabled = false;
			Dw_BeiAnZhengHao.Enabled = false;
			Combo_ShengChanChangJia.Enabled = false;
			Text_Quan.Enabled = false;
			Combo_Unit.Enabled = false;
		}
		else
		{
			Label_LiuXiang.Visible = false;
			Cb_Liuxiang.Visible = false;
			Combo_Guige.Enabled = true;
			Combo_QiangDuDengJi.Enabled = true;
			Dw_BeiAnZhengHao.Enabled = true;
			Combo_ShengChanChangJia.Enabled = true;
			Text_Quan.Enabled = true;
			Combo_Unit.Enabled = true;
		}
	}

	private void GetShaData()
	{
		string text = "";
		text = Public_Fun.HttpRequest("http://api.scetia.com/gravel.detection/ToInternalLabInfo", "{memberCode:0002}", "POST");
		SIE = JsonConvert.DeserializeObject<ShaImportEntity.ShaEntity.RetData>(text);
	}

	private void Cb_Liuxiang_SelectedIndexChanged(object sender, EventArgs e)
	{
		ChangeShaNo(Cb_Liuxiang.Text);
	}

	protected override void Dispose(bool disposing)
	{
		if (disposing && components != null)
		{
			components.Dispose();
		}
		base.Dispose(disposing);
	}

	private void InitializeComponent()
	{
		this.components = new System.ComponentModel.Container();
		System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ShouYang.Form_Import));
		this.TV_Sample = new System.Windows.Forms.TreeView();
		this.imageList1 = new System.Windows.Forms.ImageList(this.components);
		this.groupBox2 = new System.Windows.Forms.GroupBox();
		this.Cb_Liuxiang = new System.Windows.Forms.ComboBox();
		this.Label_LiuXiang = new System.Windows.Forms.Label();
		this.Combo_Unit = new System.Windows.Forms.ComboBox();
		this.label10 = new System.Windows.Forms.Label();
		this.Text_Quan = new System.Windows.Forms.TextBox();
		this.label9 = new System.Windows.Forms.Label();
		this.Text_PiHao = new System.Windows.Forms.TextBox();
		this.label1 = new System.Windows.Forms.Label();
		this.Combo_ShengChanChangJia = new System.Windows.Forms.ComboBox();
		this.label8 = new System.Windows.Forms.Label();
		this.label7 = new System.Windows.Forms.Label();
		this.Dw_BeiAnZhengHao = new Sybase.DataWindow.DataWindowControl();
		this.Combo_QiangDuDengJi = new System.Windows.Forms.ComboBox();
		this.label6 = new System.Windows.Forms.Label();
		this.label5 = new System.Windows.Forms.Label();
		this.Combo_Guige = new System.Windows.Forms.ComboBox();
		this.Combo_YPMC = new System.Windows.Forms.ComboBox();
		this.label4 = new System.Windows.Forms.Label();
		this.Combo_YPLB = new System.Windows.Forms.ComboBox();
		this.label3 = new System.Windows.Forms.Label();
		this.Combo_JCLX = new System.Windows.Forms.ComboBox();
		this.label2 = new System.Windows.Forms.Label();
		this.Dw_Import = new Sybase.DataWindow.DataWindowControl();
		this.PopUpMemu = new System.Windows.Forms.ContextMenuStrip(this.components);
		this.Sort = new System.Windows.Forms.ToolStripMenuItem();
		this.ShowColumns = new System.Windows.Forms.ToolStripMenuItem();
		this.Export = new System.Windows.Forms.ToolStripMenuItem();
		this.PrintSetUp = new System.Windows.Forms.ToolStripMenuItem();
		this.Print = new System.Windows.Forms.ToolStripMenuItem();
		this.修改样品信息ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
		this.groupBox1 = new System.Windows.Forms.GroupBox();
		this.Cb_Year = new System.Windows.Forms.CheckBox();
		this.Btn_Hide = new System.Windows.Forms.Button();
		this.button1 = new System.Windows.Forms.Button();
		this.Btn_Print = new System.Windows.Forms.Button();
		this.Btn_Export = new System.Windows.Forms.Button();
		this.Btn_Sort = new System.Windows.Forms.Button();
		this.Cb_ShowFinish = new System.Windows.Forms.CheckBox();
		this.Btn_DownLoadItem = new System.Windows.Forms.Button();
		this.button2 = new System.Windows.Forms.Button();
		this.Btn_Commit = new System.Windows.Forms.Button();
		this.Btn_Delete = new System.Windows.Forms.Button();
		this.Btn_Add = new System.Windows.Forms.Button();
		this.Dw_GetSample = new Sybase.DataWindow.DataWindowControl();
		this.groupBox2.SuspendLayout();
		this.PopUpMemu.SuspendLayout();
		this.groupBox1.SuspendLayout();
		base.SuspendLayout();
		this.TV_Sample.ImageIndex = 0;
		this.TV_Sample.ImageList = this.imageList1;
		this.TV_Sample.Location = new System.Drawing.Point(0, 1);
		this.TV_Sample.Name = "TV_Sample";
		this.TV_Sample.SelectedImageIndex = 0;
		this.TV_Sample.Size = new System.Drawing.Size(222, 657);
		this.TV_Sample.TabIndex = 11;
		this.TV_Sample.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(TV_Sample_NodeMouseClick);
		this.imageList1.ImageStream = (System.Windows.Forms.ImageListStreamer)resources.GetObject("imageList1.ImageStream");
		this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
		this.imageList1.Images.SetKeyName(0, "Kind.jpg");
		this.imageList1.Images.SetKeyName(1, "Item.jpg");
		this.imageList1.Images.SetKeyName(2, "Sample.jpg");
		this.imageList1.Images.SetKeyName(3, "Kind_back.jpg");
		this.imageList1.Images.SetKeyName(4, "Item_back.jpg");
		this.imageList1.Images.SetKeyName(5, "Sample_back.jpg");
		this.groupBox2.Controls.Add(this.Cb_Liuxiang);
		this.groupBox2.Controls.Add(this.Label_LiuXiang);
		this.groupBox2.Controls.Add(this.Combo_Unit);
		this.groupBox2.Controls.Add(this.label10);
		this.groupBox2.Controls.Add(this.Text_Quan);
		this.groupBox2.Controls.Add(this.label9);
		this.groupBox2.Controls.Add(this.Text_PiHao);
		this.groupBox2.Controls.Add(this.label1);
		this.groupBox2.Controls.Add(this.Combo_ShengChanChangJia);
		this.groupBox2.Controls.Add(this.label8);
		this.groupBox2.Controls.Add(this.label7);
		this.groupBox2.Controls.Add(this.Dw_BeiAnZhengHao);
		this.groupBox2.Controls.Add(this.Combo_QiangDuDengJi);
		this.groupBox2.Controls.Add(this.label6);
		this.groupBox2.Controls.Add(this.label5);
		this.groupBox2.Controls.Add(this.Combo_Guige);
		this.groupBox2.Controls.Add(this.Combo_YPMC);
		this.groupBox2.Controls.Add(this.label4);
		this.groupBox2.Controls.Add(this.Combo_YPLB);
		this.groupBox2.Controls.Add(this.label3);
		this.groupBox2.Controls.Add(this.Combo_JCLX);
		this.groupBox2.Controls.Add(this.label2);
		this.groupBox2.Location = new System.Drawing.Point(226, 1);
		this.groupBox2.Name = "groupBox2";
		this.groupBox2.Size = new System.Drawing.Size(786, 90);
		this.groupBox2.TabIndex = 12;
		this.groupBox2.TabStop = false;
		this.groupBox2.Text = " ";
		this.Cb_Liuxiang.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.Cb_Liuxiang.FormattingEnabled = true;
		this.Cb_Liuxiang.Location = new System.Drawing.Point(555, 60);
		this.Cb_Liuxiang.Name = "Cb_Liuxiang";
		this.Cb_Liuxiang.Size = new System.Drawing.Size(221, 20);
		this.Cb_Liuxiang.TabIndex = 67;
		this.Cb_Liuxiang.Visible = false;
		this.Cb_Liuxiang.SelectedIndexChanged += new System.EventHandler(Cb_Liuxiang_SelectedIndexChanged);
		this.Label_LiuXiang.AutoSize = true;
		this.Label_LiuXiang.Location = new System.Drawing.Point(501, 63);
		this.Label_LiuXiang.Name = "Label_LiuXiang";
		this.Label_LiuXiang.Size = new System.Drawing.Size(53, 12);
		this.Label_LiuXiang.TabIndex = 66;
		this.Label_LiuXiang.Text = "流向单号";
		this.Label_LiuXiang.Visible = false;
		this.Combo_Unit.FormattingEnabled = true;
		this.Combo_Unit.Items.AddRange(new object[16]
		{
			"m", "m²", "m³", "t", "万块", "块", "根", "个", "只", "卷",
			"套", "桶", "张", "件", "批", "盘"
		});
		this.Combo_Unit.Location = new System.Drawing.Point(289, 59);
		this.Combo_Unit.Name = "Combo_Unit";
		this.Combo_Unit.Size = new System.Drawing.Size(204, 20);
		this.Combo_Unit.TabIndex = 65;
		this.label10.AutoSize = true;
		this.label10.Location = new System.Drawing.Point(253, 63);
		this.label10.Name = "label10";
		this.label10.Size = new System.Drawing.Size(29, 12);
		this.label10.TabIndex = 64;
		this.label10.Text = "量纲";
		this.Text_Quan.Location = new System.Drawing.Point(71, 59);
		this.Text_Quan.Name = "Text_Quan";
		this.Text_Quan.Size = new System.Drawing.Size(162, 21);
		this.Text_Quan.TabIndex = 63;
		this.Text_Quan.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Text_Quan_KeyPress);
		this.label9.AutoSize = true;
		this.label9.Location = new System.Drawing.Point(18, 61);
		this.label9.Name = "label9";
		this.label9.Size = new System.Drawing.Size(53, 12);
		this.label9.TabIndex = 62;
		this.label9.Text = "供应数量";
		this.Text_PiHao.Location = new System.Drawing.Point(700, 11);
		this.Text_PiHao.Name = "Text_PiHao";
		this.Text_PiHao.Size = new System.Drawing.Size(76, 21);
		this.Text_PiHao.TabIndex = 61;
		this.label1.AutoSize = true;
		this.label1.Location = new System.Drawing.Point(647, 15);
		this.label1.Name = "label1";
		this.label1.Size = new System.Drawing.Size(53, 12);
		this.label1.TabIndex = 60;
		this.label1.Text = "进仓批号";
		this.Combo_ShengChanChangJia.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple;
		this.Combo_ShengChanChangJia.Enabled = false;
		this.Combo_ShengChanChangJia.FormattingEnabled = true;
		this.Combo_ShengChanChangJia.Location = new System.Drawing.Point(553, 37);
		this.Combo_ShengChanChangJia.Name = "Combo_ShengChanChangJia";
		this.Combo_ShengChanChangJia.Size = new System.Drawing.Size(223, 20);
		this.Combo_ShengChanChangJia.TabIndex = 59;
		this.Combo_ShengChanChangJia.SelectedIndexChanged += new System.EventHandler(Combo_ShengChanChangJia_SelectedIndexChanged);
		this.label8.AutoSize = true;
		this.label8.Location = new System.Drawing.Point(501, 40);
		this.label8.Name = "label8";
		this.label8.Size = new System.Drawing.Size(53, 12);
		this.label8.TabIndex = 57;
		this.label8.Text = "生产厂家";
		this.label7.AutoSize = true;
		this.label7.Location = new System.Drawing.Point(236, 38);
		this.label7.Name = "label7";
		this.label7.Size = new System.Drawing.Size(53, 12);
		this.label7.TabIndex = 56;
		this.label7.Text = "备案证号";
		this.Dw_BeiAnZhengHao.DataWindowObject = "";
		this.Dw_BeiAnZhengHao.LibraryList = "";
		this.Dw_BeiAnZhengHao.Location = new System.Drawing.Point(289, 34);
		this.Dw_BeiAnZhengHao.Name = "Dw_BeiAnZhengHao";
		this.Dw_BeiAnZhengHao.Size = new System.Drawing.Size(204, 21);
		this.Dw_BeiAnZhengHao.TabIndex = 58;
		this.Dw_BeiAnZhengHao.Text = "dataWindowControl1";
		this.Dw_BeiAnZhengHao.EditChanged += new Sybase.DataWindow.EditChangedEventHandler(Dw_BeiAnZhengHao_EditChanged);
		this.Dw_BeiAnZhengHao.ItemChanged += new Sybase.DataWindow.ItemChangedEventHandler(Dw_BeiAnZhengHao_ItemChanged);
		this.Combo_QiangDuDengJi.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.Combo_QiangDuDengJi.Location = new System.Drawing.Point(553, 11);
		this.Combo_QiangDuDengJi.Name = "Combo_QiangDuDengJi";
		this.Combo_QiangDuDengJi.Size = new System.Drawing.Size(92, 20);
		this.Combo_QiangDuDengJi.Sorted = true;
		this.Combo_QiangDuDengJi.TabIndex = 10;
		this.label6.AutoSize = true;
		this.label6.Location = new System.Drawing.Point(500, 14);
		this.label6.Name = "label6";
		this.label6.Size = new System.Drawing.Size(53, 12);
		this.label6.TabIndex = 11;
		this.label6.Text = "强度等级";
		this.label5.AutoSize = true;
		this.label5.Location = new System.Drawing.Point(352, 15);
		this.label5.Name = "label5";
		this.label5.Size = new System.Drawing.Size(29, 12);
		this.label5.TabIndex = 7;
		this.label5.Text = "规格";
		this.Combo_Guige.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.Combo_Guige.Location = new System.Drawing.Point(381, 11);
		this.Combo_Guige.Name = "Combo_Guige";
		this.Combo_Guige.Size = new System.Drawing.Size(113, 20);
		this.Combo_Guige.Sorted = true;
		this.Combo_Guige.TabIndex = 9;
		this.Combo_YPMC.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple;
		this.Combo_YPMC.Enabled = false;
		this.Combo_YPMC.FormattingEnabled = true;
		this.Combo_YPMC.Location = new System.Drawing.Point(71, 35);
		this.Combo_YPMC.Name = "Combo_YPMC";
		this.Combo_YPMC.Size = new System.Drawing.Size(162, 20);
		this.Combo_YPMC.TabIndex = 5;
		this.label4.AutoSize = true;
		this.label4.Location = new System.Drawing.Point(18, 39);
		this.label4.Name = "label4";
		this.label4.Size = new System.Drawing.Size(53, 12);
		this.label4.TabIndex = 4;
		this.label4.Text = "样品名称";
		this.Combo_YPLB.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple;
		this.Combo_YPLB.Enabled = false;
		this.Combo_YPLB.FormattingEnabled = true;
		this.Combo_YPLB.Location = new System.Drawing.Point(240, 11);
		this.Combo_YPLB.Name = "Combo_YPLB";
		this.Combo_YPLB.Size = new System.Drawing.Size(110, 20);
		this.Combo_YPLB.TabIndex = 3;
		this.label3.AutoSize = true;
		this.label3.Location = new System.Drawing.Point(183, 14);
		this.label3.Name = "label3";
		this.label3.Size = new System.Drawing.Size(53, 12);
		this.label3.TabIndex = 2;
		this.label3.Text = "样品类别";
		this.Combo_JCLX.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple;
		this.Combo_JCLX.Enabled = false;
		this.Combo_JCLX.FormattingEnabled = true;
		this.Combo_JCLX.Location = new System.Drawing.Point(71, 11);
		this.Combo_JCLX.Name = "Combo_JCLX";
		this.Combo_JCLX.Size = new System.Drawing.Size(108, 20);
		this.Combo_JCLX.TabIndex = 1;
		this.label2.AutoSize = true;
		this.label2.Location = new System.Drawing.Point(18, 14);
		this.label2.Name = "label2";
		this.label2.Size = new System.Drawing.Size(53, 12);
		this.label2.TabIndex = 0;
		this.label2.Text = "检测类型";
		this.Dw_Import.ContextMenuStrip = this.PopUpMemu;
		this.Dw_Import.DataWindowObject = "";
		this.Dw_Import.LibraryList = "";
		this.Dw_Import.Location = new System.Drawing.Point(226, 95);
		this.Dw_Import.Name = "Dw_Import";
		this.Dw_Import.ScrollBars = Sybase.DataWindow.DataWindowScrollBars.VerticalAndHorizontalSplit;
		this.Dw_Import.Size = new System.Drawing.Size(785, 414);
		this.Dw_Import.TabIndex = 13;
		this.Dw_Import.Text = "dataWindowControl1";
		this.Dw_Import.EditChanged += new Sybase.DataWindow.EditChangedEventHandler(Dw_Import_EditChanged);
		this.Dw_Import.ItemFocusChanged += new Sybase.DataWindow.ItemFocusChangedEventHandler(Dw_Import_ItemFocusChanged);
		this.Dw_Import.ItemChanged += new Sybase.DataWindow.ItemChangedEventHandler(Dw_Import_ItemChanged);
		this.Dw_Import.RowFocusChanged += new Sybase.DataWindow.RowFocusChangedEventHandler(Dw_Import_RowFocusChanged);
		this.Dw_Import.SqlPreview += new Sybase.DataWindow.SqlPreviewEventHandler(Dw_Import_SqlPreview);
		this.Dw_Import.Click += new System.EventHandler(Dw_Import_Click);
		this.Dw_Import.KeyDown += new System.Windows.Forms.KeyEventHandler(Dw_Import_KeyDown);
		this.Dw_Import.MouseClick += new System.Windows.Forms.MouseEventHandler(Dw_Import_MouseClick);
		this.PopUpMemu.Items.AddRange(new System.Windows.Forms.ToolStripItem[6] { this.Sort, this.ShowColumns, this.Export, this.PrintSetUp, this.Print, this.修改样品信息ToolStripMenuItem });
		this.PopUpMemu.Name = "PopUpMemu";
		this.PopUpMemu.Size = new System.Drawing.Size(185, 136);
		this.PopUpMemu.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(PopUpMemu_ItemClicked);
		this.Sort.Name = "Sort";
		this.Sort.ShortcutKeys = System.Windows.Forms.Keys.S | System.Windows.Forms.Keys.Control;
		this.Sort.Size = new System.Drawing.Size(184, 22);
		this.Sort.Text = "排序";
		this.Sort.ToolTipText = "排序";
		this.ShowColumns.Name = "ShowColumns";
		this.ShowColumns.ShortcutKeys = System.Windows.Forms.Keys.L | System.Windows.Forms.Keys.Control;
		this.ShowColumns.Size = new System.Drawing.Size(184, 22);
		this.ShowColumns.Text = "显示/隐藏列";
		this.ShowColumns.ToolTipText = "可编译表格中需要显示的列";
		this.Export.Name = "Export";
		this.Export.ShortcutKeys = System.Windows.Forms.Keys.E | System.Windows.Forms.Keys.Control;
		this.Export.Size = new System.Drawing.Size(184, 22);
		this.Export.Text = "导出数据";
		this.Export.ToolTipText = "可将表格中的数据导出各类格式";
		this.PrintSetUp.Name = "PrintSetUp";
		this.PrintSetUp.ShortcutKeys = System.Windows.Forms.Keys.U | System.Windows.Forms.Keys.Control;
		this.PrintSetUp.Size = new System.Drawing.Size(184, 22);
		this.PrintSetUp.Text = "打印设置";
		this.PrintSetUp.ToolTipText = "设置打印表格时的打印属性";
		this.Print.Name = "Print";
		this.Print.ShortcutKeys = System.Windows.Forms.Keys.P | System.Windows.Forms.Keys.Control;
		this.Print.Size = new System.Drawing.Size(184, 22);
		this.Print.Text = "打印";
		this.Print.ToolTipText = "打印当前表格的内容";
		this.修改样品信息ToolStripMenuItem.Name = "修改样品信息ToolStripMenuItem";
		this.修改样品信息ToolStripMenuItem.Size = new System.Drawing.Size(184, 22);
		this.修改样品信息ToolStripMenuItem.Text = "修改进料信息";
		this.groupBox1.Controls.Add(this.Cb_Year);
		this.groupBox1.Controls.Add(this.Btn_Hide);
		this.groupBox1.Controls.Add(this.button1);
		this.groupBox1.Controls.Add(this.Btn_Print);
		this.groupBox1.Controls.Add(this.Btn_Export);
		this.groupBox1.Controls.Add(this.Btn_Sort);
		this.groupBox1.Controls.Add(this.Cb_ShowFinish);
		this.groupBox1.Controls.Add(this.Btn_DownLoadItem);
		this.groupBox1.Controls.Add(this.button2);
		this.groupBox1.Controls.Add(this.Btn_Commit);
		this.groupBox1.Controls.Add(this.Btn_Delete);
		this.groupBox1.Controls.Add(this.Btn_Add);
		this.groupBox1.Location = new System.Drawing.Point(0, 659);
		this.groupBox1.Name = "groupBox1";
		this.groupBox1.Size = new System.Drawing.Size(1008, 58);
		this.groupBox1.TabIndex = 14;
		this.groupBox1.TabStop = false;
		this.Cb_Year.AutoSize = true;
		this.Cb_Year.Checked = true;
		this.Cb_Year.CheckState = System.Windows.Forms.CheckState.Checked;
		this.Cb_Year.Location = new System.Drawing.Point(12, 34);
		this.Cb_Year.Name = "Cb_Year";
		this.Cb_Year.Size = new System.Drawing.Size(108, 16);
		this.Cb_Year.TabIndex = 18;
		this.Cb_Year.Text = "只显示本年数据";
		this.Cb_Year.UseVisualStyleBackColor = true;
		this.Btn_Hide.Location = new System.Drawing.Point(226, 16);
		this.Btn_Hide.Name = "Btn_Hide";
		this.Btn_Hide.Size = new System.Drawing.Size(82, 32);
		this.Btn_Hide.TabIndex = 17;
		this.Btn_Hide.Text = "隐藏/显示列";
		this.Btn_Hide.UseVisualStyleBackColor = true;
		this.Btn_Hide.Visible = false;
		this.Btn_Hide.Click += new System.EventHandler(Btn_Hide_Click);
		this.button1.Location = new System.Drawing.Point(380, 16);
		this.button1.Name = "button1";
		this.button1.Size = new System.Drawing.Size(78, 32);
		this.button1.TabIndex = 16;
		this.button1.Text = "打印设置";
		this.button1.UseVisualStyleBackColor = true;
		this.button1.Visible = false;
		this.button1.Click += new System.EventHandler(button1_Click_1);
		this.Btn_Print.Location = new System.Drawing.Point(458, 16);
		this.Btn_Print.Name = "Btn_Print";
		this.Btn_Print.Size = new System.Drawing.Size(78, 32);
		this.Btn_Print.TabIndex = 15;
		this.Btn_Print.Text = "打印";
		this.Btn_Print.UseVisualStyleBackColor = true;
		this.Btn_Print.Visible = false;
		this.Btn_Print.Click += new System.EventHandler(Btn_Print_Click);
		this.Btn_Export.Location = new System.Drawing.Point(536, 16);
		this.Btn_Export.Name = "Btn_Export";
		this.Btn_Export.Size = new System.Drawing.Size(99, 32);
		this.Btn_Export.TabIndex = 14;
		this.Btn_Export.Text = "导出当前数据";
		this.Btn_Export.UseVisualStyleBackColor = true;
		this.Btn_Export.Visible = false;
		this.Btn_Export.Click += new System.EventHandler(button1_Click);
		this.Btn_Sort.Location = new System.Drawing.Point(308, 16);
		this.Btn_Sort.Name = "Btn_Sort";
		this.Btn_Sort.Size = new System.Drawing.Size(72, 32);
		this.Btn_Sort.TabIndex = 13;
		this.Btn_Sort.Text = "排序";
		this.Btn_Sort.UseVisualStyleBackColor = true;
		this.Btn_Sort.Visible = false;
		this.Btn_Sort.Click += new System.EventHandler(Btn_Sort_Click);
		this.Cb_ShowFinish.AutoSize = true;
		this.Cb_ShowFinish.Checked = true;
		this.Cb_ShowFinish.CheckState = System.Windows.Forms.CheckState.Checked;
		this.Cb_ShowFinish.Location = new System.Drawing.Point(12, 16);
		this.Cb_ShowFinish.Name = "Cb_ShowFinish";
		this.Cb_ShowFinish.Size = new System.Drawing.Size(120, 16);
		this.Cb_ShowFinish.TabIndex = 5;
		this.Cb_ShowFinish.Text = "只显示未取样材料";
		this.Cb_ShowFinish.UseVisualStyleBackColor = true;
		this.Btn_DownLoadItem.Location = new System.Drawing.Point(199, 15);
		this.Btn_DownLoadItem.Name = "Btn_DownLoadItem";
		this.Btn_DownLoadItem.Size = new System.Drawing.Size(21, 32);
		this.Btn_DownLoadItem.TabIndex = 4;
		this.Btn_DownLoadItem.Text = "下载参数信息";
		this.Btn_DownLoadItem.UseVisualStyleBackColor = true;
		this.Btn_DownLoadItem.Visible = false;
		this.Btn_DownLoadItem.Click += new System.EventHandler(Btn_DownLoadItem_Click);
		this.button2.Location = new System.Drawing.Point(922, 16);
		this.button2.Name = "button2";
		this.button2.Size = new System.Drawing.Size(78, 32);
		this.button2.TabIndex = 3;
		this.button2.Text = "退出";
		this.button2.UseVisualStyleBackColor = true;
		this.button2.Click += new System.EventHandler(button2_Click);
		this.Btn_Commit.Location = new System.Drawing.Point(825, 16);
		this.Btn_Commit.Name = "Btn_Commit";
		this.Btn_Commit.Size = new System.Drawing.Size(97, 32);
		this.Btn_Commit.TabIndex = 2;
		this.Btn_Commit.Text = "提交进料信息";
		this.Btn_Commit.UseVisualStyleBackColor = true;
		this.Btn_Commit.Click += new System.EventHandler(Btn_Commit_Click);
		this.Btn_Delete.Location = new System.Drawing.Point(635, 16);
		this.Btn_Delete.Name = "Btn_Delete";
		this.Btn_Delete.Size = new System.Drawing.Size(93, 32);
		this.Btn_Delete.TabIndex = 1;
		this.Btn_Delete.Text = "删除所选材料";
		this.Btn_Delete.UseVisualStyleBackColor = true;
		this.Btn_Delete.Click += new System.EventHandler(Btn_Delete_Click);
		this.Btn_Add.Location = new System.Drawing.Point(728, 16);
		this.Btn_Add.Name = "Btn_Add";
		this.Btn_Add.Size = new System.Drawing.Size(97, 32);
		this.Btn_Add.TabIndex = 0;
		this.Btn_Add.Text = "保存修改";
		this.Btn_Add.UseVisualStyleBackColor = true;
		this.Btn_Add.Click += new System.EventHandler(Btn_Add_Click);
		this.Dw_GetSample.DataWindowObject = "";
		this.Dw_GetSample.LibraryList = "";
		this.Dw_GetSample.Location = new System.Drawing.Point(226, 517);
		this.Dw_GetSample.Name = "Dw_GetSample";
		this.Dw_GetSample.ScrollBars = Sybase.DataWindow.DataWindowScrollBars.VerticalAndHorizontalSplit;
		this.Dw_GetSample.Size = new System.Drawing.Size(786, 141);
		this.Dw_GetSample.TabIndex = 15;
		this.Dw_GetSample.Text = "dataWindowControl1";
		base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 12f);
		base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
		base.ClientSize = new System.Drawing.Size(1012, 718);
		base.Controls.Add(this.Dw_GetSample);
		base.Controls.Add(this.groupBox1);
		base.Controls.Add(this.Dw_Import);
		base.Controls.Add(this.groupBox2);
		base.Controls.Add(this.TV_Sample);
		base.MaximizeBox = false;
		base.Name = "Form_Import";
		base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
		this.Text = "原料进仓台账";
		base.Load += new System.EventHandler(Form_Import_Load);
		this.groupBox2.ResumeLayout(false);
		this.groupBox2.PerformLayout();
		this.PopUpMemu.ResumeLayout(false);
		this.groupBox1.ResumeLayout(false);
		this.groupBox1.PerformLayout();
		base.ResumeLayout(false);
	}
}
